/**
 * @author 0283000115
 * @date 2018年3月3日-下午1:40:56
 */
package com.zte.claa.inficombo.csa.app.controller.ret;

import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * @author 0283000115
 *
 */
public class ApiResult<T> {
	public static final int RET_SUCC = 0; //0表示成功；
	public static final int RET_FAIL = 1; //1表示失败；
	public static final int RET_INVALID_TOKEN = 2; //2 token无效.
	
	private int result;
	private String remark;
	private T data;

	public ApiResult(){
		
	}

	/**
	 * @return the result
	 */
	public int getResult() {
		return result;
	}

	/**
	 * @param result the result to set
	 */
	public void setResult(int result) {
		this.result = result;
	}

	/**
	 * @return the remark
	 */
	public String getRemark() {
		return remark;
	}

	/**
	 * @param remark the remark to set
	 */
	public void setRemark(String remark) {
		this.remark = remark;
	}

	/**
	 * @return the data
	 */
	public T getData() {
		return data;
	}

	/**
	 * @param data the data to set
	 */
	public void setData(T data) {
		this.data = data;
	}

	/**
	 * 判断结果是否成功
	 * @return
	 */
	@JsonIgnore
	public boolean isRetSucc(){
		return this.result == RET_SUCC;
	}
}
